<? if(!session_id()); session_start(); ?>
<? 
require("../config.php");
require("../common_start.php");
$errMsg='';

if (isset($_POST['btnLogin'])){
	$uid = $_POST['txtUid'];
	$pwd = $_POST['txtPwd'];
	$sql = "select * from tbl_user where uid='".$uid."' and pwd='".$pwd."' limit 1";
	if (mysql_num_rows(mysql_query($sql,$conn))>0) {
		$log = $uid;
		session_register("log");
		$_SESSION['log'] = $uid;
		echo "<script>window.location='./'</script>";
	}else{
		$errMsg="Tên đăng nhập / mật khẩu không đúng !";
	}
} 
?>
<html>
<head>
<link href="../themes/styles/css/izishop.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<LINK href="../lib/cssAdmin.css" rel="stylesheet" type="text/css">
<title></title>
<script language="javascript" src="../lib/md5.js"></script>
<script language="javascript" src="../lib/javascript.lib.js"></script>
<script language="javascript" src="../lib/varAlert.vn.unicode.js"></script>
<script language="javascript">
function btnLogin_onClick(){
	if(test_empty(document.frmLogin.txtUid.value)){
		alert('Hãy nhập "tên đăng nhập" !');document.frmLogin.txtUid.focus();return false;
	}
	if(test_empty(document.frmLogin.txtPwd.value)){
		alert('Hãy nhập "mật khẩu" !');document.frmLogin.txtPwd.focus();return false;
	}
	document.frmLogin.txtPwd.value = hex_md5(document.frmLogin.txtPwd.value);
	return true;
                    
}
</script>
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body onLoad="document.frmLogin.txtUid.focus();">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
	<tr>
		<td valign="top">
<form method="post" name="frmLogin" style="padding-top:50px">
<div class="content">
    <div class="module_common">
        <h2><b class="login" title="LOGINĐăng nhập"></b></h2>
        <div class="wrap">
            <div class="wrap_child">
                
                    <div class="login_left">
                        <form method="post" id="login_form">
                        <table>
                        <tr><? if($errMsg!=''){echo '<p align=left class="err">'.$errMsg.'<br>&nbsp;</p>';}?></tr>
                            <tr>
                                <td>Tài khoản: </td>
                                <td><input type="text" name="txtUid" class="text width5" /></td>
                            </tr>
                            <tr>
                                <td>Mật khẩu: </td>
                                <td><input type="password" name="txtPwd" class="text width5" /></td>
                            </tr>
                                                        <tr class="distance">
                                <td></td>
                                <td>
                                  <input type="submit" name="btnLogin" value="" class="enter" onclick="return btnLogin_onClick();"/>                                  
                                  
                                </td>
                            </tr>
                        </table>
                       
                        </form>
                        
                    </div>
                   

                    
                </div>
          
        </div>
    </div>
</div>
</form>

		</td>
	</tr>
</table>
	

</body>
</html>
<? require("../common_end.php") ?>

